package com.akmedia.lacommunity.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.elasticsearch.annotations.Document;

import java.time.LocalDateTime;

/**
 * @author ZJL
 * @date 2025/5/21
 * 随笔实体
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "essay_index")
public class Essay {
    /**
     * 随笔ID
     */
    private Integer eid;
    /**
     * 发送随笔的用户
     */
    private User user;
    /**
     * 随笔类型
     */
    private ContentType contentType;
    /**
     * 随笔标题
     */
    private String title;
    /**
     * 随笔内容
     */
    private String content;
    /**
     * 随笔状态
     */
    private Integer status;
    /**
     * 随笔发布时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;
}

